home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000217-20000824 / 000037_news@columbia.edu _Tue Feb 22 10:10:24 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  1KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id KAA12015
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Tue, 22 Feb 2000 10:10:24 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id JAA13755
  7.     for kermit.misc@watsun.cc.columbia.edu; Tue, 22 Feb 2000 09:50:03 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: Peter Easthope <peter_easthope@gulfnet.pinc.com>
  10. Subject: Array name passed to macro as argument?
  11. Date: Tue, 22 Feb 2000 14:35:01 GMT
  12. Organization: GulfNet
  13. Message-ID: <88u6ql$vmg$1@nnrp1.deja.com>
  14. To: kermit.misc@columbia.edu
  15.  
  16. ; Can the name of an array be passed to a macro via an
  17. ; argument?  This message can be interpreted as an example
  18. ; but the syntax fails.  Any suggestions?
  19.  
  20. ; Thanks,    peter_easthope@gulfnet.pinc.com
  21.  
  22. ; ================================================
  23. ; pass the name of an array to Test as an argument.
  24. def Test {
  25.   echo {\%1[1]}
  26.   echo {\%1[2]}
  27. }
  28.  
  29. declare \&d[2]
  30. def \&d[1] {Sea}
  31. def \&d[2] {urchin}
  32. echo {\&d[1]}
  33. echo {\&d[2]}
  34. echo {Now try passing the array name to Test.}
  35. Test \&d
  36.  
  37.  
  38. Sent via Deja.com http://www.deja.com/
  39. Before you buy.